import sqlite3
import pandas as pd

# 连接到数据库
conn = sqlite3.connect(r'C:\Users\Administrator\OneDrive\Database\STORE_SOLD.db')

df = pd.read_sql_query("SELECT * FROM store_sold", conn)

# 检查重复的订单编号
duplicates = df[df.duplicated('订单编号', keep=False)]

print(f'共有 {len(duplicates)} 条重复订单记录')

# 打印前几条重复记录
print('\n前几条重复记录:')
print(duplicates.head())

conn.close()